<template>
  <view class="my-search-container" :style="{ 'background-color': bgcolor}">
    <!-- 这是自定义的搜索组件 -->
     <view class="my-search-box" :style="{ 'border-radius': radius + 'px'}" @click="toSearch">
        <uni-icons type="search" size="18"></uni-icons>
        <text class="placeholder">搜索</text>
     </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    props: {
      // 背景颜色
      bgcolor: {
         type: String,
         default: '#c00000'
      },
      // 圆角尺寸
      radius: {
        type: Number,
        default: 18
      }
    },
    data() {
      return {
       
      };
    },
    methods: {
      toSearch() {
        //console.log('777');
        this.$emit('myclick')
      }
    }
  }
</script>

<style lang="scss">
.my-search-container {
  //background-color: #c00000;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  .my-search-box {
    width: 94%;
    height: 36px;
    background-color: #fff;
   //border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    .placeholder {
      font-size: 15px;
    }
  }
}
</style>